(function() {
        var d = document, ec = encodeURIComponent;
        domains = new Array("www.baidu.com",
                                                        "www.google.com.hk",
                                                        "www.yahoo.cn",
                                                        "www.soso.com",
                                                        "www.sogou.com",
                                                        "www.youdao.com",
                                                        "cn.bing.com",
                                                        "search.sina.com.cn");
        function domainUrl() {
		server = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dc.emarbox.com';
                return server;
        }

        var createImg = function(url) {
                var img = new Image(1, 1);
                img.onload=function(){
            img.onload=null;
        };
        img.src = url;
    };

        var refer = d.referrer;
        if (refer != "" && refer != undefined){

                var domain = refer.split('/')[2];

                var isContain = false;
                for ( var i = 0; i < domains.length; i++) {
                        var _domain = domains[i];
                        if (domain == _domain){
                                isContain = true;
                                break;
                        }
                }

                var track = function trackdata() {
                        var reqUrl = domainUrl() + "/_s.gif?ref=" + ec(refer) + "&domain=" + domain + "&pt=3";
                        createImg(reqUrl);
                };

                if (isContain) {
                        setTimeout(track, 500);
                };
        }
})();